def copy(srcpath,dstpath):
    srcfile=open(srcpath,'r')
    dstfile=open(dstpath,'w')
    for line in srcfile:
        dstfile.write(line)
    srcfile.close()
    dstfile.close()
copy('test.txt','test.bak')
